#include <iostream>
#include <string>

#define __TEST__
#include "thread_pool.hpp"
#undef __TEST__
#include "task.hpp"

std::string opers = "+-*/%#";

int main()
{
    ThreadPool<Task>* tp = new ThreadPool<Task>;
    tp->start();

    while (true)
    {
        int left = rand() % 10;
        int right = rand() % 10;
        Task t(left, right, opers[rand() % opers.size()]);
        std::cout << "产生一个任务: " << t.get_task() << std::endl;
        tp->push(std::move(t));
        
        sleep(1);
    }

    return 0;
}